package com.jrx.anytxn.transaction.mapper.ext;

import com.jrx.anytxn.transaction.entity.TlChargeoffInfo;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

public interface ExtTlChargeoffInfoMapper {

    /**
     * 根据订单号 租户号查询 核销订单表
     * @param loanId
     * @param tenantId
     * @param customerId
     * @return
     */
    List<TlChargeoffInfo> selectByLoanIdAndCustomerId(@Param("loanId")String loanId,
                                                    @Param("tenantId") String tenantId,
                                                    @Param("customerId") String customerId);


    /**
     * 根据订单号 租户号 修改核销原因码与描述
     *
     * @param request 账户信息
     * @return
     */
    int updateCodeByLoanIdAndTenantId(TlChargeoffInfo request);


    /**
     * 根据订单 租户号删除 核销订单
     * @param tenantId
     * @param id
     * @return
     */
    int deleteByTenantIdAndLoanId(@Param("tenantId")String tenantId, @Param("id")Long id,@Param("customerId") String customerId);


    /**
     * 批量更新核销信息
     *
     * @param tlChargeoffInfoList
     * @return
     */
    int batchUpdateStatusTlChargeoffInfo(TlChargeoffInfo tlChargeoffInfoList);


    List<TlChargeoffInfo> selectByResultForBatch(@Param("result") String result);

    int batchInsert(List<TlChargeoffInfo> list);


    /**
     * 根据订单号 租户号查询 核销订单表
     * @param loanId
     * @param tenantId
     * @return
     */
    List<TlChargeoffInfo> selectByLoanIdAndResult(@Param("loanId")String loanId,
                                                  @Param("tenantId") String tenantId,
                                                  @Param("customerId") String customerId,
                                                  @Param("resultList") List<String> resultList);

    TlChargeoffInfo selectByIdAndTenantId(@Param("tenantId") String tenantId,
                                          @Param("customerId") String customerId,
                                          @Param("id") Long id);


    /**
     * 根据订单号 租户号查询 核销订单表
     * @param loanId
     * @param tenantId
     * @return
     */
    List<TlChargeoffInfo> selectByLoanIdAndTenantId(@Param("loanId")String loanId,
                                                    @Param("tenantId") String tenantId);
}
